﻿// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.

// Write your JavaScript code.
/*分页*/
/*
	参数解释：
	cont	        容器Id
	pagecount	    页面数量

*/
function sf_page(cont, pagecount) {
    laypage({
        cont: cont,
        pages: pagecount,
        curr: function () { //通过url获取当前页，也可以同上（pages）方式获取
            var page = location.search.match(/page=(\d+)/);
            return page ? page[1] : 1;
        }(),
        jump: function (e, first) { //触发分页后的回调
            var url = location.href;
            var newUrl = url.replace(/(\\?|^|&|\#)page=([^&|^#]*)(&|$|#)/, "");
            if (!first) { //一定要加此判断，否则初始时会无限刷新
                if (newUrl.indexOf("?") != -1) {
                    location.href = newUrl + "&page=" + e.curr;
                } else {
                    location.href = newUrl + "?page=" + e.curr;
                }
            }
        }
    });
}

//
//function edit_show(title, url, w, h){
//    layer_show(title, url, w, h);
//}

